<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="Registar Conta"></h:outputText>
            <br />
            <h2>Autor</h2>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="Username: " for="username" />
                    <h:inputText id="username" value="#{autorController.selected.username}" title="Username" />
                    <h:outputLabel value="Password: " for="password" />
                    <h:inputSecret id="password" value="#{autorController.selected.password}" title="Password" />
                    <h:outputLabel value="Confirmar password: " for="confirmarPassword" />
                    <h:inputSecret id="confirmarPassword" value="#{autorController.confirmarPassword}" title="Confirmar Password" />
                    <h:outputLabel value="Número de BI: " for="numeroBI" />
                    <h:inputText id="numeroBI" value="#{autorController.selected.numeroBI}" title="Número de BI" />
                    <h:outputLabel value="Primeiro Nome: " for="pNome" />
                    <h:inputText id="pNome" value="#{autorController.selected.pNome}" title="Primeiro Nome" />
                    <h:outputLabel value="Ultimo Nome" for="uNome" />
                    <h:inputText id="uNome" value="#{autorController.selected.uNome}" title="Ultimo Nome" />
                    <h:outputLabel value="Email: " for="email" />
                    <h:inputText id="email" value="#{autorController.selected.email}" title="Email" />
                    <h:outputLabel value="Data de Nascimento: " for="dataNascimento" />
                    <h:inputText id="dataNascimento" value="#{autorController.selected.dataNascimento}" title="Data de Nascimento" >
                        <f:convertDateTime pattern="dd/MM/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="Empresa: " for="empresa" />
                    <h:inputText id="empresa" value="#{autorController.selected.empresa}" title="Empresa" />

                </h:panelGrid>
                <br />
                <h:commandLink action="#{autorController.create}" value="Registar" />
                <br />
                <br />
                <h:commandLink value="Lista Eventos" action="/evento/List" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
